;Assembler header file for Joystick
;written by DefMod (Oct 26 2000) on Tue Dec 12 18:10:42 2000
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 18 May 1995

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET OSLib:oslib.Hdr.Types"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET OSLib:oslib.Hdr.OS"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Joystick_Hdr
        GBLS    Joystick_Hdr

;Symbols for constants
Joystick_X                      *       &FF
Joystick_Y                      *       &FF00
Joystick_Switches               *       &FF0000
Joystick_XShift                 *       0
Joystick_YShift                 *       8
Joystick_SwitchesShift          *       16
Joystick_HalfWordX              *       &FFFF
Joystick_HalfWordY              *       &FFFF0000
Joystick_HalfWordXShift         *       0
Joystick_HalfWordYShift         *       16

;Symbols for structure offsets and sizes
Joystick_State                  *       Bits

Joystick_HalfWordState          *       Bits


;Symbols for SWI's and SWI reason codes
XJoystick_Read                  *       &63F40
Joystick_Read                   *       &43F40
   ;Entry
   ;  R0 = joystick_no (Int)
   ;Exit
   ;  R0 = state (Joystick_State)

XJoystick_ReadHalfWord          *       &63F40
Joystick_ReadHalfWord           *       &43F40
   ;Entry
   ;  R0 = &100 :OR: joystick_no (Int)
   ;Exit
   ;  R0 = state (Joystick_HalfWordState)
   ;  R1 = switches (Bits)

XJoystick_CalibrateTopRight     *       &63F41
Joystick_CalibrateTopRight      *       &43F41

XJoystick_CalibrateBottomLeft   *       &63F42
Joystick_CalibrateBottomLeft    *       &43F42

        ]
        END
